const { exec } = require('../db/mysql')

// 用户登录
const userLogin = userData => {
  const { username, password } = userData
  let sql = `select * from user where username='${username}' and password='${password}'`
  return exec(sql).then(res => {
    return res[0] || ''
  })
}

module.exports = {
  userLogin
}
